package j07object;

import java.util.Arrays;

public class J2arrays {
    public static void main(String[] args) {
        int[] arr = {1,3,5,7,9};
        System.out.println(Arrays.binarySearch(arr,5));//2
        System.out.println(Arrays.binarySearch(arr,6));//负数

        int[] arr2 = Arrays.copyOf(arr,3);
        System.out.println(Arrays.toString(arr2));//135

        int[] arr0 = new int[10];
        Arrays.fill(arr0,8);
        System.out.println(Arrays.toString(arr0));

        System.out.println("====");
        int[] arr100 = {3,5,1,7,2};
        Arrays.sort(arr100);
        System.out.println(Arrays.toString(arr100));
    }
}
